<%--
  Created by IntelliJ IDEA.
  User: xuweijie
  Date: 17-5-11
  Time: 下午8:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<html>
<head>
    <title>顾客信息详情</title>
    <link rel="stylesheet" href="${Layui}/css/layui.css" media="all">
    <script src="${Layui}/layui.js" charset="utf-8"></script>
    <script src="${jquery}/jquery-3.1.1.js" charset="utf-8"></script>
    <script src="${Js}/admin/customer.js" charset="utf-8"></script>
</head>
<body style="margin-left:10px;margin-right: 10px">
<input type="text" value="${pageIndex}" hidden id="pageIndex">
<input type="text" value="${pageCount}" hidden id="pageCount">
<input type="text" value="${croCustomer.id}" hidden id="croCustomerid">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>顾客详情</legend>
</fieldset>
<table class="layui-table" lay-even="" lay-skin="nob">
    <colgroup>
        <col width="80">
        <col width="80">
        <col width="50">
        <col width="60">
        <col width="50">
        <col width="70">
        <col width="70">
        <col width="70">
        <col width="100">
        <col width="100">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>用户名</th>
        <th>类型</th>
        <th>状态</th>
        <th>头像</th>
        <th>性别</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>账户余额(元)</th>
        <th>注册日期</th>
        <th>更新日期</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>${croCustomer.username}</td>
        <td>${SysDict['customer_type'][croCustomer.type]}</td>
        <td>${SysDict['customer_status'][croCustomer.freeze_flag]}</td>
        <td><img src="${croCustomer.photo}" width="32" height="32"></td>
        <td>${croCustomer.sex}</td>
        <td>${croCustomer.phone}</td>
        <td>${croCustomer.email}</td>
        <td>${croCustomer.balance}</td>
        <td><fmt:formatDate value="${croCustomer.signdate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
        <td><fmt:formatDate value="${croCustomer.updatedate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
    </tr>
    </tbody>
</table>
<c:if test="${fn:length(croAddresses)>0}">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>收货地址</legend>
    </fieldset>
    <%--收货地址信息--%>
    <table class="layui-table" lay-even="" lay-skin="row">
        <colgroup>
            <col width="50">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="100">
            <col width="100">
            <col width="100">
            <col width="100">
            <col width="60">
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>收货人</th>
            <th>国家</th>
            <th>省份</th>
            <th>城市</th>
            <th>详细地址</th>
            <th>邮编</th>
            <th>联系电话</th>
            <th>创建日期</th>
            <th>更新日期</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:set var="i" value="${0}" />
        <c:forEach items="${croAddresses}" var="address">
            <tr>
                <c:set var="i" value="${i+1}" />
                <td>${i}</td>
                <td>${address.consignee}</td>
                <td>${address.country.name}</td>
                <td>${address.provience.name}</td>
                <td>${address.city.name}</td>
                <td>${address.address}</td>
                <td>${address.postcode}</td>
                <td>${address.phone}</td>
                <td><fmt:formatDate value="${address.createtime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                <td><fmt:formatDate value="${address.updatetime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                <td>
                    <div class="layui-btn-group">
                        <a data-method="deleteaddr" addressid="${address.id}" customerid="${croCustomer.id}"  class="layui-btn  layui-btn-small layui-btn-danger deladdr">删除</a>
                    </div>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</c:if>
<c:if test="${fn:length(croAddresses)==0}">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>该用户暂无收货地址</legend>
    </fieldset>
</c:if>

<%--分页显示区域--%>
<div id="detailpage"></div>
</body>
</html>
